﻿//操作服务地址
var API_HOST = "http://192.168.2.219:80/WebSite/" ;
//封装ajax
$.ajax_request = function (method,url,data,callbackFun){
	$.ajax({
		type: method,
		url: url,
		async: false,		
		dataType: 'JSONP',
		jsonp: "callbackparam",
		data:data,
		success: function(obj) {
			if(callbackFun){
				callbackFun(obj);
			}
		},
		error: function (obj){
			alert("请求出错！")
		}
	});	
}
//html传参
var request ={
	QueryString : function(val){
		var uri = window.location.search;
		var re = new RegExp("" +val+ "=([^&?]*)", "ig");
		return ((uri.match(re))?(uri.match(re)[0].substr(val.length+1)):null);
    }
}
//加载下方广告
function load_ad(adType,loadType){
	var url = API_HOST + "Ad_ad";
	var param={
		"adType":adType,
		"loadType":loadType
	}
	$.ajax_request("GET",url,param,function (obj){
		var data = obj.data;
		$(".panel_footer").empty();
		var str = "<a href='" +data.url + "'><span><font color='#b99000'>" + data.name + "</font></span></a>";
		$(".panel_footer").append(str);
	}); 	
}